package file;

import java.io.File;
import java.io.FileFilter;

public class ListFileSDemo2 {
    public static void main(String[] args) {
        File dir = new File(".");
        FileFilter filter  = new FileFilter() {
            public boolean accept(File file) {
                String name = file.getName();
                System.out.println("正在过来的元素是:"+name);
                return name.startsWith(".");
            }
        };
        File[] subs = dir.listFiles(filter);
        System.out.println("当前目录下共:"+subs.length+"个子项");
    }
}
